<template>
    <div class="">
        <div class="title">
            <span>借款记录</span>
        </div>
        <div class="container">
            <el-tabs v-model="message">
                    <el-table :data="unread" :show-header="false" style="width: 100%">
                        <el-table-column align="center">
                            <template slot-scope="scope">
                                <span class="message-title">极速借</span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center">
                            <template slot-scope="scope" >
                                <div class="message-title1">放款日期</div>
                                <div class="message-conter">{{scope.row.loanTime}}</div>
                            </template>
                        </el-table-column>
                        <el-table-column align="center">
                            <template slot-scope="scope" >
                                <div class="message-title1">借款额度（元）</div>
                                <div class="message-conter">{{scope.row.amount/100}}</div>
                            </template>
                        </el-table-column>
                        <!-- <el-table-column align="center">
                            <template slot-scope="scope">
                                <div class="message-title1">利率</div>
                                <div class="message-conter">0.05%</div>
                            </template>
                        </el-table-column>
                        <el-table-column align="center">
                            <template slot-scope="scope">
                                <div class="message-title1">到账类型</div>
                                <div class="message-conter">到期还本付息</div>
                            </template>
                        </el-table-column> -->
                        <el-table-column align="center">
                            <template slot-scope="scope">
                                <div class="message-title1">放款状态</div>
                                <el-button type="primary" v-if="scope.row.status == 1">待资金方放款</el-button>
                                <el-button type="success" v-if="scope.row.status == 2">放款完成</el-button>
                                <el-button type="info" v-if="scope.row.status == 99">还款已结清</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
            </el-tabs>
        </div>
    </div>
</template>

<script>
    import {jsyGetloan} from '@/api/api';
    export default {
        name: 'tabs',
        data() {
            return {
                message: 'first',
                showHeader: false,
                unread: [],
                username:''
            }
        },
        created(){
            this.getPermissions()
            this.jsyGetloan()
        },
        methods: {
            //获取权限
            getPermissions(){
                var aaa = sessionStorage.getItem('userInfo')
                var bbb = JSON.parse(aaa)
                this.username = bbb.username
            },
            jsyGetloan(){
                jsyGetloan({
                    merchantNo:this.username
                }).then(res => {
                    if(res.code == 405){
                        sessionStorage. removeItem('token')
                        this.$router.push('/login');
                    }else if(res.code == 200){
                        console.log(res)
                        this.unread = res.data.list
                    }
                })
            }
        },
        computed: {
        }
    }

</script>

<style>
.title {
  background: #fff;
  padding: 10px 10px;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
}
.message-title{
    /* cursor: pointer; */
    font-size: 22px;
}
.handle-row{
    margin-top: 30px;
}
.message-title1{
    color: #999;
}
.message-conter{
    font-size: 16px;
    font-weight: 600;
}
</style>